#ifndef PID_H
#define PID_H

#include <cmath>
#include <qdebug.h>

class PID
{
public:
    PID();
    double G_targetLocation;
    double G_presentLocation;
    float Kp, Ki, Kd;
    double error_p;		//kp err
    double error_i;		//ki err
    double error_d;		//kd err
    double error_dp;	//pre kp_err,for caculating kd_err
    bool the_1st_update=true;
    double cur_error;
    void PID_Update();
};

#endif // PID_H
